package com.lifp.entity;

import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.experimental.FieldNameConstants;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author lifp
 * @date 2024/05/29
 */
@Data
@ApiModel
@FieldNameConstants
@Document("employee")
public class Employee {
    /**
    * 编号
    */
    @Id
    private Long id;

    /**
    * 姓名
    */
    private String name;

    /**
    * 年龄
    */
    private Integer age;

    /**
    * 住址
    */
    private String address;

    /**
    * 入职日期
    */
    @Field("joined_date")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date joinedDate;
}
